package com.fk.dao.impl;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.List;

import com.fk.entity.XinWenFenLei;
import com.fk.uitl.DBManager;

public class XinWenFenLeiDaoImpl {
	
	//新闻分类
	public List<XinWenFenLei> getXinWenFenLeiList(){
		List<XinWenFenLei> xwflList=new ArrayList<XinWenFenLei>();
		
		Connection conn=DBManager.getConnection();
		Statement st=null;
		ResultSet rs=null;
		try {
			st=conn.createStatement();
			rs=st.executeQuery("select * from xinwenfenlei");
			while(rs.next()) {
				int xinWenId=rs.getInt("xinWenId");
				String xinWenFenLei=rs.getString("xinWenFenLei");
				XinWenFenLei xwfl=new XinWenFenLei(xinWenId, xinWenFenLei);
				xwflList.add(xwfl);
			}
			return xwflList;
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
			return null;
		} finally {
			DBManager.closeAll(conn, st, rs);
		}
	}
	
}
